import { BelongsToMany, Column, DataType, ForeignKey, Model, Table } from "sequelize-typescript";
import SysRole from "./sys.role.entity";
import SysUser from "./sys.user.entity";
 

@Table({
    underscored: true,
    comment: '用户角色关联表',
    tableName: 'sys_user_role',
    freezeTableName: true
})
class UserRole extends Model<UserRole> {
    @Column({ 
        autoIncrement: true,
        primaryKey: true, 
     })
    id: number
    
    @ForeignKey(() => SysRole)
    @Column
    roleId: number

    @ForeignKey(() => SysUser)
    @Column
    userId: number
}
export default UserRole;